home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / sndpla1a / sounds.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-24  |  3.3 KB  |  91 lines

  1. VERSION 5.00
  2. Begin VB.Form sndPlayer 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "sndPlayer"
  5.    ClientHeight    =   1950
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   1590
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   1950
  13.    ScaleWidth      =   1590
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.CommandButton cmdPlay 
  17.       Caption         =   "Play"
  18.       Height          =   255
  19.       Left            =   0
  20.       TabIndex        =   2
  21.       Top             =   1680
  22.       Width           =   495
  23.    End
  24.    Begin VB.FileListBox File1 
  25.       Height          =   1650
  26.       Left            =   0
  27.       Pattern         =   "*.mid;*.mp3;*.mpe;*.wav"
  28.       TabIndex        =   0
  29.       Top             =   0
  30.       Width           =   1575
  31.    End
  32.    Begin VB.CommandButton cmdPause 
  33.       Caption         =   "Pause"
  34.       Height          =   255
  35.       Left            =   480
  36.       TabIndex        =   3
  37.       Top             =   1680
  38.       Width           =   615
  39.    End
  40.    Begin VB.CommandButton cmdStop 
  41.       Caption         =   "Stop"
  42.       Height          =   255
  43.       Left            =   1080
  44.       TabIndex        =   1
  45.       Top             =   1680
  46.       Width           =   495
  47.    End
  48. Attribute VB_Name = "sndPlayer"
  49. Attribute VB_GlobalNameSpace = False
  50. Attribute VB_Creatable = False
  51. Attribute VB_PredeclaredId = True
  52. Attribute VB_Exposed = False
  53. Public Sub sndPlayW(Filename As String)
  54.     Call sndPlaySound(Filename, SND_ASYNC Or SND_NODEFAULT Or SND_NOSTOP)
  55. End Sub
  56. Public Sub sndPlayM(Filename As String)
  57.     Call mciSendString("Open " & Filename & " Alias MM", 0, 0, 0)
  58.     Call mciSendString("Play MM", 0, 0, 0)
  59. End Sub
  60. Public Sub sndPauseM()
  61.     Call mciSendString("Stop MM", 0, 0, 0)
  62. End Sub
  63. Public Sub sndStartM()
  64.     If Mid(File1.Filename, (Len(File1.Filename) - 3), 4) = ".mid" Then
  65.         sndPlayM (File1.Path & "\" & File1.Filename)
  66.     ElseIf Mid(File1.Filename, (Len(File1.Filename) - 3), 4) = ".mp3" Then
  67.         sndPlayM (File1.Path & "\" & File1.Filename)
  68.     ElseIf Mid(File1.Filename, (Len(File1.Filename) - 4), 5) = ".mpeg" Then
  69.         sndPlayM (File1.Path & "\" & File1.Filename)
  70.     ElseIf Mid(File1.Filename, (Len(File1.Filename) - 3), 4) = ".wav" Then
  71.         sndPlayW (File1.Path & "\" & File1.Filename)
  72.     End If
  73. End Sub
  74. Public Sub sndStopM()
  75.     Call mciSendString("Stop MM", 0, 0, 0)
  76.     Call mciSendString("Close MM", 0, 0, 0)
  77. End Sub
  78. Private Sub cmdPause_Click()
  79.     sndPauseM
  80. End Sub
  81. Private Sub cmdPlay_Click()
  82.     sndStartM
  83. End Sub
  84. Private Sub cmdStop_Click()
  85.     sndStopM
  86. End Sub
  87. Private Sub Form_Load()
  88.     Call MsgBox("sndPlayer - By: Argonaut" & Chr(13) & Chr(13) & "This is a simple little app that" & Chr(13) & "will show you have to Start," & Chr(13) & "Pause and Stop different Media" & Chr(13) & "Files such as Midi's, Mpeg's," & Chr(13) & "Mp3's, and Wav's." & Chr(13) & "Everything is done by calls," & Chr(13) & "No more controls needed." & Chr(13) & "More stuff to come later." & Chr(13) & Chr(13) & "www.vbstuff.cjb.net", , "sndPlayer About")
  89.     File1.Path = "C:\windows\desktop\"
  90. End Sub
  91.